package com.jjlin.leetcode.biweekly_contest.no40_2020_11_28;

//最大重复子字符串
public class Solution1 {

    //使用String.indexOf()
    public int maxRepeating(String sequence, String word) {
        int res = 0;
        String t = word;
        while(sequence.indexOf(t) != -1){
            res++;
            t += word;
        }
        return res;
    }
}
